﻿namespace shuixianhua 
{
    internal class Program
    {
        static void Main(string[] args)
        {
           
                Console.WriteLine("100-999之间的水仙花数有：");

                int count = 0; 

                // 循环100到999之间的所有三位数
                for (int num = 100; num <= 999; num++)
                {
                    
                    int hundred = num / 100;      
                    int ten = (num / 10) % 10;    
                    int one = num % 10;           

         
                    int sum = hundred * hundred * hundred +
                              ten * ten * ten +
                              one * one * one;

                    // 判断是否是水仙花数
                    if (sum == num)
                    {
                        Console.WriteLine(num + " = " + hundred + "³ + " + ten + "³ + " + one + "³");
                        count++;
                    }
                }
                .
                Console.WriteLine("共有 " + count + " 个水仙花数");
            }
        }
    
    
}
